Skip to content

(A014) [ModelExecution] update code for execution of a compiled model#424

Merged
adeas31 merged 1 commit intoOpenModelica:masterfrom
syntron:ModelExecution
Mar 12, 2026
Merged

(A014) [ModelExecution] update code for execution of a compiled model#424
adeas31 merged 1 commit intoOpenModelica:masterfrom
syntron:ModelExecution

Conversation

@syntron
Copy link
Contributor

@syntron syntron commented Feb 18, 2026

  • rename ModelicaSystemCmd => ModelExecutionCmd
  • rename OMCSessionRunData => ModelExecutionData
  • create class ModelExecutionException
  • move some code:
    • OMCSession.omc_run_data_update() => merge into ModelExecutionCmd.define()
    • OMCSession.run_model_executable() => ModelExecutionData.run()
  • additonal cleanup

see PR #404

@syntron syntron changed the title (A014) [ModelExecution] update code for executoin of a compiled model (A014) [ModelExecution] update code for execution of a compiled model Feb 18, 2026
@syntron syntron force-pushed the ModelExecution branch 4 times, most recently from bd659ba to 20df470 Compare February 27, 2026 18:09
@adeas31
Copy link
Member

adeas31 commented Mar 9, 2026

Please rebase.

[ModelExecution*] create classes to handle model execution

* rename ModelicaSystemCmd => ModelExecutionCmd
* rename OMCSessionRunData => ModelExecutionData
* create class ModelExecutionException
* move some code:
  * OMCSession.omc_run_data_update() => merge into ModelExecutionCmd.define()
  * OMCSession.run_model_executable() => ModelExecutionData.run()

[test_ModelicaSystemCmd] update unittest

[ModelExecutionData] include the original exception if reraised as ModelExecutionException

[ModelicaSystem] fix usage of ModelicaSystemCmd
if modelname is None:
raise ModelicaSystemError("Missing model name!")
if model_name is None:
raise ModelExecutionException("Missing model name!")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why are we doing this?

model_name is allowed to be omitted (= None). But if it is omitted or explicitly passed as None, we raise an exception.

It is better to do model_name: str and we can still keep the check.

@adeas31 adeas31 merged commit 4ae625b into OpenModelica:master Mar 12, 2026
10 checks passed
@syntron syntron deleted the ModelExecution branch March 13, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants